/*
 * Vacation.java
 *
 * Created on 20 marzec 2007, 19:53
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package data;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

/**
 *
 * @author xavex
 */
public class Vacation implements Serializable, IDbObject {
    
    private Long id;
    private Date vacationDate;    
    private Set<Employee> employees = new HashSet();
    
    /** Creates a new instance of Vacation */
    public Vacation() {
    }
    

    public Long getId() {
        return this.id;
    }

    private void setId(final Long id) {
        this.id = id;
    }

    public Date getVacationDate() {
        return this.vacationDate;
    }

    public void setVacationDate(final Date vacationDate) {
        this.vacationDate = vacationDate;
    }

    public Set<Employee> getEmployees() {
        return this.employees;
    }

    public void setEmployees(final Set<Employee> employees) {
        this.employees = employees;
    }
    
  public boolean equals(Object aThat)
  {
      if ( this == aThat ) return true;
      if ( !(aThat instanceof Vacation) ) return false;

      if( id == null )
          return super.equals( aThat );
      else
          return this.id.equals( ((Vacation)aThat).id );
  }

    public int hashCode()
    {
        if( id != null )
            return id.hashCode();
        else
            return super.hashCode();
    }
  

}
